package gui;

import java.sql.ResultSet;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;

public class Utils {

	public static Table createTableFromResultSet(Composite playlistComposite, ResultSet playlist_details) {
		// TODO Auto-generated method stub
		
		return null;
		
	}
	
	public static void popUpBox(String title, String message, Shell shell){
		int messageBoxStyle = SWT.ICON_WARNING | SWT.OK;
		MessageBox messageBox = new MessageBox(shell, messageBoxStyle);
		messageBox.setText(title);
		messageBox
				.setMessage(message);
		messageBox.open();
	}
	public static void runInThread(Runnable run1){
		Thread thread = new Thread(run1);
		thread.start();
	}
	public static void popUpFailure(Shell shell){
		popUpBox("Database failure", "Sux", shell);
	}

	
	public static void loadingCursor(Display display, Shell shell){
		shell.setCursor(new Cursor(display, SWT.CURSOR_WAIT));
	}
	public static void regularCursor(Display display, Shell shell){
		shell.setCursor(new Cursor(display, SWT.CURSOR_ARROW));
	}
}
